import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

@Entity('driver_info',{database:'daijia_driver'}) // 指定数据库表名
export class DriverInfo {
  @ApiProperty({ description: '用户ID', example: 1 })
  @PrimaryGeneratedColumn({ type: 'bigint', name: 'id',  comment: '用户ID' })
  id: number;

  @ApiProperty({ description: '微信OpenID', example: 'wx1234567890abcdef' })
  @Column({ type: 'varchar', length: 200, nullable: false, comment: '微信OpenID' })
  wx_open_id: string;

  @ApiProperty({ description: '昵称', example: '张三', required: true })
  @Column({ type: 'varchar', length: 200, nullable: false, comment: '昵称' })
  nickname: string;

  @ApiProperty({ description: '头像URL', example: 'http://example.com/avatar.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '头像URL' })
  avatar_url: string;

  @ApiProperty({ description: '电话号码', example: '12345678901', required: false })
  @Column({ type: 'char', length: 11, nullable: true, comment: '电话号码' })
  phone: string;

  @ApiProperty({ description: '真实姓名', example: '张三', required: false })
  @Column({ type: 'varchar', length: 20, nullable: true, comment: '真实姓名' })
  name: string;

  @ApiProperty({ description: '性别：1-男，2-女', example: '1', required: true })
  @Column({ type: 'char', length: 1, nullable: false, default: '1', comment: '性别：1-男，2-女' })
  gender: string;

  @ApiProperty({ description: '生日', example: '1990-01-01', required: false })
  @Column({ type: 'date', nullable: true, comment: '生日' })
  birthday: Date;

  @ApiProperty({ description: '身份证号', example: '123456789012345678', required: false })
  @Column({ type: 'varchar', length: 18, nullable: true, comment: '身份证号' })
  idcard_no: string;

  @ApiProperty({ description: '身份证地址', example: '北京市朝阳区某街道', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '身份证地址' })
  idcard_address: string;

  @ApiProperty({ description: '身份证有效期', example: '2030-01-01', required: false })
  @Column({ type: 'date', nullable: true, comment: '身份证有效期' })
  idcard_expire: Date;

  @ApiProperty({ description: '身份证正面照片URL', example: 'http://example.com/idcard_front.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '身份证正面照片URL' })
  idcard_front_url: string;

  @ApiProperty({ description: '身份证背面照片URL', example: 'http://example.com/idcard_back.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '身份证背面照片URL' })
  idcard_back_url: string;

  @ApiProperty({ description: '手持身份证照片URL', example: 'http://example.com/idcard_hand.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '手持身份证照片URL' })
  idcard_hand_url: string;

  @ApiProperty({ description: '驾驶证类型', example: 'C1', required: false })
  @Column({ type: 'varchar', length: 20, nullable: true, comment: '驾驶证类型' })
  driver_license_class: string;

  @ApiProperty({ description: '驾驶证号', example: '12345678901234567890', required: false })
  @Column({ type: 'varchar', length: 100, nullable: true, comment: '驾驶证号' })
  driver_license_no: string;

  @ApiProperty({ description: '驾驶证有效期', example: '2025-01-01', required: false })
  @Column({ type: 'date', nullable: true, comment: '驾驶证有效期' })
  driver_license_expire: Date;

  @ApiProperty({ description: '驾驶证签发日期', example: '2020-01-01', required: false })
  @Column({ type: 'date', nullable: true, comment: '驾驶证签发日期' })
  driver_license_issue_date: Date;

  @ApiProperty({ description: '驾驶证正面照片URL', example: 'http://example.com/license_front.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '驾驶证正面照片URL' })
  driver_license_front_url: string;

  @ApiProperty({ description: '驾驶证背面照片URL', example: 'http://example.com/license_back.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '驾驶证背面照片URL' })
  driver_license_back_url: string;

  @ApiProperty({ description: '手持驾驶证照片URL', example: 'http://example.com/license_hand.jpg', required: false })
  @Column({ type: 'varchar', length: 200, nullable: true, comment: '手持驾驶证照片URL' })
  driver_license_hand_url: string;

  @ApiProperty({ description: '紧急联系人姓名', example: '李四', required: false })
  @Column({ type: 'varchar', length: 20, nullable: true, comment: '紧急联系人姓名' })
  contact_name: string;

  @ApiProperty({ description: '紧急联系人电话', example: '12345678901', required: false })
  @Column({ type: 'char', length: 11, nullable: true, comment: '紧急联系人电话' })
  contact_phone: string;

  @ApiProperty({ description: '紧急联系人关系', example: '朋友', required: false })
  @Column({ type: 'varchar', length: 20, nullable: true, comment: '紧急联系人关系' })
  contact_relationship: string;

  @ApiProperty({ description: '人脸模型ID', example: 'face_model_12345', required: false })
  @Column({ type: 'varchar', length: 100, nullable: true, comment: '人脸模型ID' })
  face_model_id: string;

  @ApiProperty({ description: '工号', example: 'JOB12345', required: false })
  @Column({ type: 'varchar', length: 50, nullable: true, comment: '工号' })
  job_no: string;

  @ApiProperty({ description: '评分', example: 9.0, required: true })
  @Column({ type: 'decimal', precision: 10, scale: 2, nullable: false, default: 9.0, comment: '评分' })
  score: number;

  @ApiProperty({ description: '订单数量', example: 0, required: true })
  @Column({ type: 'int', nullable: false, default: 0, comment: '订单数量' })
  order_count: number;

  @ApiProperty({ description: '认证状态：0-未认证，1-已认证', example: 0, required: true })
  @Column({ type: 'tinyint', nullable: false, default: 0, comment: '认证状态：0-未认证，1-已认证' })
  auth_status: number;

  @ApiProperty({ description: '状态：1-启用，0-禁用', example: 1, required: true })
  @Column({ type: 'tinyint', nullable: false, default: 1, comment: '状态：1-启用，0-禁用' })
  status: number;

  @ApiProperty({ description: '创建时间', example: '2023-01-01T00:00:00.000Z' })
  @CreateDateColumn({
    type: 'timestamp',
     comment: '创建时间',
  })
  create_time: Date;

  @ApiProperty({ description: '更新时间', example: '2023-01-01T00:00:00.000Z' })
  @UpdateDateColumn({
    type: 'timestamp',
     comment: '更新时间',
  })
  update_time: Date;

  @ApiProperty({ description: '是否删除：0-未删除，1-已删除', example: 0, required: true })
  @Column({ type: 'tinyint', nullable: false, default: 0, comment: '是否删除：0-未删除，1-已删除' })
  is_deleted: number;
}